package com.smart.entity;

import lombok.Data;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import com.smart.vo.AppSSCarVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;

/**
 * @author lgb
 * @date 2020年6月11日 上午11:56:37
 * Copyright (C) 深圳工勘科技
 * @说明: 智慧工地-作业记录表
 **/
@Data
@NoArgsConstructor
@TableName("ss_work")
@EqualsAndHashCode(callSuper=true)
@ApiModel(value="智慧工地-作业记录表")
public class SsWork extends Model<SsWork>{

	private static final long serialVersionUID = 802653004268640953L;

    @TableId
    @ApiModelProperty(value="id")
    @TableField(value="id")
    private Integer id;
    @ApiModelProperty(value="设备编号")
    @TableField(value="no")
    private String no;
    /** 桩id */
    @ApiModelProperty(value = "桩id")
    @TableField(value = "pile_id")
    private Integer pileId;
    /** 桩编号 */
    @ApiModelProperty(value="桩编号")
    @TableField(value="pile_no")
    private String pileNo;
    /** 司机姓名 */
    @ApiModelProperty(value="司机姓名")
    @TableField(value="name")
    private String name;
    /** 工地id */
    @ApiModelProperty(value = "工地id")
    @TableField(value = "site_id")
    private Integer siteId;
    /** 车辆编号 */
    @ApiModelProperty(value = "车辆编号")
    @TableField(value = "car_no")
    private String carNo;
    /** 车辆类型 */
    @ApiModelProperty(value = "车辆类型")
    @TableField(value = "car_type")
    private String carType;
    /** 桩径 */
    @ApiModelProperty(value = "桩径")
    @TableField(value = "pile_diameter")
    private String pileDiameter;
    /** 开始时间 */
    @ApiModelProperty(value = "开始时间")
    @TableField(value="start_time")
    private String startTime;
    /** 完成时间 */
    @ApiModelProperty(value="完成时间")
    @TableField(value="complate_time")
    private String complateTime;
    /** 岩层 */
    @ApiModelProperty(value = "岩层")
    @TableField(value = "rock_stratum")
    private BigDecimal rockStratum;
    /** 土层 */
    @ApiModelProperty(value = "土层")
    @TableField(value = "soil_layer")
    private BigDecimal soilLayer;
    /** 机械类型时长 */
    @ApiModelProperty(value = "机械类型时长")
    @TableField(value = "cumulative")
    private BigDecimal cumulative;
    /** 备注 */
    @ApiModelProperty(value = "备注")
    @TableField(value = "remarks")
    private String remarks;
    /** 图片(作业图片，多张用逗号分隔) */
    @ApiModelProperty(value = "图片(作业图片，多张用逗号分隔)")
    @TableField(value = "pic_url")
    private String picUrl;
    /** 创建时间 */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String createTime;
    /** 用户id */
    @ApiModelProperty(value = "用户id")
    @TableField(value = "user_id")
    private Integer userId;
    /** 作业时间 */
    @ApiModelProperty(value = "作业时间")
    @TableField(value = "work_time")
    @JsonFormat(pattern = "yyyy-MM-dd ")
    private String workTime;
    /** 建议理由 */
    @TableField(value="reason")
    private String reason;
    /** 审批状态(0:审批中1:通过2:未通过) */
    @TableField(value="status")
    private Integer status;
    
    public SsWork(AppSSCarVO vo,SsPile appSsPile, String createTime,Long userId) {
        this.pileId = appSsPile.getId();
        this.carNo = vo.getCarNo();
        this.siteId = vo.getSiteId();
        this.createTime = createTime;
        this.userId = Integer.valueOf(String.valueOf(userId));
    }
}